home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 December / enter-cd-12-2005.iso / Internet / SpamAware 4.0 / SpamAware-Setup.exe / {app} / rules / 20_uri_tests.cf < prev    next >
Encoding:
Text File  |  2005-06-20  |  5.0 KB  |  120 lines

  1. # SpamAssassin rules file: URI tests
  2. #
  3. # Please don't modify this file as your changes will be overwritten with
  4. # the next update. Use @@LOCAL_RULES_DIR@@/local.cf instead.
  5. # See 'perldoc Mail::SpamAssassin::Conf' for details.
  6. #
  7. # <@LICENSE>
  8. # Copyright 2004 Apache Software Foundation
  9. # Licensed under the Apache License, Version 2.0 (the "License");
  10. # you may not use this file except in compliance with the License.
  11. # You may obtain a copy of the License at
  12. #     http://www.apache.org/licenses/LICENSE-2.0
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS,
  15. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. # See the License for the specific language governing permissions and
  17. # limitations under the License.
  18. # </@LICENSE>
  19. #
  20. ###########################################################################
  21.  
  22. require_version @@VERSION@@
  23.  
  24. uri NUMERIC_HTTP_ADDR        /^https?\:\/\/\d{7,}/is
  25. describe NUMERIC_HTTP_ADDR    Uses a numeric IP address in URL
  26.  
  27. uri NORMAL_HTTP_TO_IP        /^https?\:\/\/(?:\S*\@)?\d+\.\d+\.\d+\.\d+/i
  28. describe NORMAL_HTTP_TO_IP    Uses a dotted-decimal IP address in URL
  29.      
  30. # Theo sez:
  31. # Have gotten FPs off this, and whitespace can't be in the host, so...
  32. # %    Visit my homepage: http://i.like.foo.com %
  33. uri HTTP_ESCAPED_HOST        /^https?\:\/\/[^\/\s]*%[0-9a-fA-F][0-9a-fA-F]/
  34. describe HTTP_ESCAPED_HOST    Uses %-escapes inside a URL's hostname
  35.  
  36. # note: do not match \r or \n
  37. uri HTTP_CTRL_CHARS_HOST    /^https?\:\/\/[^\/\s]*[\x00-\x08\x0b\x0c\x0e-\x1f]/
  38. describe HTTP_CTRL_CHARS_HOST    Uses control sequences inside a URL hostname
  39.  
  40. # look for URI with escaped 0-9, A-Z, or a-z characters (all other safe
  41. # characters have been well-tested, but are sometimes unnecessarily escaped
  42. # in nonspam; requiring "http" or "https" also reduces false positives).
  43. uri HTTP_EXCESSIVE_ESCAPES    /^https?:\/\/\S*%(?:3\d|[46][1-9a-f]|[57][\da])/i
  44. describe HTTP_EXCESSIVE_ESCAPES    Completely unnecessary %-escapes inside a URL
  45.  
  46. # bug 1801
  47. uri IP_LINK_PLUS    /^https?\:\/\/(?:\S*\@)?\d+\.\d+\.\d+\.\d+.{0,20}(?:cgi|click|ads|id\=)/i
  48. describe IP_LINK_PLUS    Dotted-decimal IP address followed by CGI
  49.  
  50. uri REMOVE_PAGE            /^https?:\/\/[^\/]+\/.*?remove/
  51. describe REMOVE_PAGE        URL of page called "remove"
  52.      
  53. uri MAILTO_TO_SPAM_ADDR        /^mailto:[a-z]+\d{2,}\@/is
  54. describe MAILTO_TO_SPAM_ADDR    Includes a link to a likely spammer email
  55.      
  56. uri MAILTO_TO_REMOVE        /^mailto:.*?remove/is
  57. describe MAILTO_TO_REMOVE    Includes a 'remove' email address
  58.  
  59. # allow ports 80 and 443 which are http and https, respectively
  60. # we don't want to hit http://www.cnn.com:USArticle1840@www.liquidshirts.com/
  61. # though, which actually doesn't have a weird port in it.
  62. uri WEIRD_PORT            m{https?://[^/\s]+?:\d+(?<!:80)(?<!:443)(?<!:8080)(?:/|\s|$)}
  63. describe WEIRD_PORT        Uses non-standard port number for HTTP
  64.  
  65. # looks for a (maybe empty) username and (optional) password in an url
  66. uri USERPASS                    m{^https?://[^/\s]*?(?::[^/\s]+?)?\@}
  67. describe USERPASS               URL contains username and (optional) password
  68.  
  69. uri URI_IS_POUND        m{\#$}
  70. describe URI_IS_POUND        Filename is just a '\#'; probably a JS trick
  71.  
  72. uri BARGAIN_URL            /bargain([sz]|-\S+)?\.(?:com|biz)/
  73. describe BARGAIN_URL        Includes a link to a likely spammer domain
  74.  
  75. # this is somewhat loose, but results are good
  76. uri BIZ_TLD              /\.biz(?:\/|$)/i
  77. describe BIZ_TLD        Contains an URL in the BIZ top-level domain    
  78.  
  79. uri INFO_TLD            /^(?:https?:\/\/|mailto:)[^\/]+\.info(?:\/|$)/i
  80. describe INFO_TLD        Contains an URL in the INFO top-level domain    
  81.  
  82. # Matt Cline
  83. # Pretty good for most folks, except for jm: I have a really stupid
  84. # e-commerce bunch obfuscating their URLs with this for some reason. screw 'em
  85. # jm: hesitant to remove this outright; it should be good against phishers
  86. #uri      HTTP_ENTITIES_HOST    m{https?://[^\s\">/]*\&\#[\da-f]+}i
  87. #describe HTTP_ENTITIES_HOST    URI obscured with character entities
  88.  
  89. uri YAHOO_RD_REDIR        m{^https?\://rd\.yahoo\.com/(?:[0-9]{4,}|partner\b|dir\b)}i
  90. describe YAHOO_RD_REDIR        Has Yahoo Redirect URI
  91.  
  92. uri YAHOO_DRS_REDIR        m{^https?://drs\.yahoo\.com/}i
  93. describe YAHOO_DRS_REDIR    Has Yahoo Redirect URI
  94.  
  95. uri URI_OFFERS            m/offer([sz]|-\S+)?\.(?:com|bi?z)/i
  96. describe URI_OFFERS        Message has link to company offers
  97.  
  98. uri URI_4YOU            m@^(?:https?://|mailto:)[^\/]*4you@i
  99. describe URI_4YOU        Message has URI 4you
  100.  
  101. # 0 nonspam hits, hundreds of spam hits.  Serious problems there
  102. uri TERRA_ES            /terra\.es\//i
  103. describe TERRA_ES        Contains URI to a document hosted at 'terra.es'
  104.  
  105. # "www" hidden as "%77%77%77", "ww%77", etc.
  106. # note: *not* anchored to start of string, to catch use of redirectors
  107. uri HTTP_77            /http:\/\/.{0,2}\%77/
  108. describe HTTP_77        Contains an URL-encoded hostname (HTTP77)
  109.  
  110. # affiliateid, aff_id, aff_sub_id etc.
  111. uri URI_AFFILIATE        /aff\w+id=/i
  112. describe URI_AFFILIATE        Contains a URI with an affiliate ID code
  113.  
  114. # really a URI rule
  115. header URI_REDIRECTOR        eval:check_for_http_redirector()
  116. describe URI_REDIRECTOR        Message has HTTP redirector URI
  117.